<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="apple-themes-web-app-capable" content="yes">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no">
		<title>在线充值</title>
		<link rel="stylesheet" href="${s.base}/mobile/css/main.css" type="text/css" media="all">
		<style type="text/css">
			/***图片上传***/
			.famous-upload-pic{display:block; text-align: left; position: relative; margin: 14px 5px; padding-bottom:20px; width: 105px;
				height: 105px;
			}
			.famous-upload-pic .upload-avatar{display: block; width: 105px; height: 105px; margin-top: 14px;}
			.famous-upload-pic .upload{width: 105px; height: 105px; opacity: 0; position: absolute; top: 0;}
			.famous-upload-pic .desc{font-size: 1.2rem; color: #666;}
		</style>

	</head>

	<body>
		<header id="header">
			<div class="header_con">
				<a href="${s.base}/phone/home?memberId=${member.id}"><span></span></a>
                <div class="top_tit">
					在线充值
				</div>
			</div>
		</header>

		<div id="content_div">
			<input type="hidden" id="memberId" value="${member.id}"/>
			<div class="pay_02" >
              <p class="border_bottom">昵称 <span><input type="text" value="${member.nickName}" id="nickName" style="width: 100%;height: 0.8rem;line-height: 0.8rem;border: 0px; text-align: right;margin-bottom:2px;" placeholder="请输入昵称" /></span></p>
		    </div>
			<div class="pay_02" >
				<p class="border_bottom">手机号 <span><input type="text" value="${member.phone}" id="phone"  style="width: 100%;height: 0.8rem;line-height: 0.8rem;border: 0px; text-align: right;margin-bottom:2px;" placeholder="请输入手机号" /></span></p>
			</div>
			<div class="pay_02" >
				<p class="border_bottom">钻石 <span><input type="number" value="${recharge.money}" id="money"  style="width: 100%;height: 0.8rem;line-height: 0.8rem;border: 0px; text-align: right;margin-bottom:2px;" placeholder="请输入钻石数" /></span></p>
			</div>
			<div style="background-color: #fff;">
			<div class="pay_02" style="border:none;">
				<textarea id="description" placeholder="请输入充值凭证" style="width: 98%; margin-left:1%; padding:5px 0px; height: 1.4rem;line-height: 0.5rem;margin-bottom:2px;border: 1px solid #ededed; border-radius:5px;" >${recharge.description}</textarea>
			</div>
			<div class="layui-form-item layui-row layui-col-xs12" style="background-color: #fff;">
				<div class="layui-input-block">
					<div class="famous-upload-pic">
						<img  <#if recharge.image?if_exists  >src="${recharge.image}"<#else>src="${s.base}/image/icon_addpic.png"</#if> class="upload-avatar" id="upload-avatar" />
						<input type="file" name="myfiles" class="upload" id="myFile" onchange="ajaxFileUploads('myFile','image','upload-avatar')">
						<input type="hidden" class="image" id="image" <#if recharge.image?if_exists  > value="${recharge.image}"  <#else> value="/image/icon_addpic.png" </#if> />
					</div>
				</div>
			</div>
			</div>
		    <div class="pay_04 margin_top_1"><a class="ui-btn" onclick="saveOrUpdate()">立即修改</a></div>
  		</div>
            <!--底部-->
			<!--底部结束-->
		   
        <script type="text/javascript" src="${s.base}/mobile/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
		<script type="text/javascript" src="${s.base}/js/layer/layer.js"></script>
		<script type="text/javascript" src="${s.base}/js/base/commont.js"></script>
		<script type="text/javascript" src="${s.base}/js/base/ajaxfileupload.js"></script>
		<script type="text/javascript">
            /**
             * 添加
             */
            function saveOrUpdate() {
                var memberId=$("#memberId").val();
                var nickName=$("#nickName").val();
                var description=$("#description").val();
                var money=$("#money").val();
                var image=$("#image").val();
                if (money == null || ""==money){
                    layer.alert("请输入钻石数");
                    return false;
                }

                $.ajax({
                    type: "POST",
                    url: "/recharge/updateOrAddEntity",
                    data: {"memberId":memberId,"money":money,"description":description,"memberName":nickName,"image":image},
                    success: function(result){
                        if(1==result.returnInfo.state){
                            showLayerAlertNoRefre("保存成功");
                        }else{
                            showLayerAlertNoRefre(result.returnInfo.errorMsg);
                        }
                    },
                    error: function(result){
                        showLayerAlertNoRefre(result);
                    }
                });
            }

		</script>

	</body>

</html>